<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%@ include file="/common/taglibs.jsp"%>
<style type="text/css">
.dateWidth1{
   width:195px;
}
.select_width{
   width:130px;
}
</style>
<div class="t_bar"><span class="color_red">*</span>推荐单位信息</div>
<table class="t_css table01" id="recommend_company1" width="100%" border="0" cellpadding="0" id="recommend" cellspacing="1">
	<col width="12%"/>
	<col width="22%"/>
	<col width="22%"/>
	<col width="10%"/>
	<col width="14%"/>
	<col width="20%"/>
	<tr class="li_2">
		<td align="right" >推荐单位：</td>
		<td colspan="5">
		 <c:set var="recomend_org">
		{'id':'<x:out select="$xmlData/data/proposal/recomend_org_value" />',
		'name':'<x:out select="$xmlData/data/proposal/recomend_org_name" />'
		}					
		</c:set> <cpt:tree id="recomend_org" key="recommended_org"
				cacheable="false" className="hn_iuput_kuang required selectWidth3"
				readonly="true" value="${recomend_org}" label="推荐单位"
				showPattern="all" shieldPattern="0"
				onClick="initTreeValue2_qhh">
			</cpt:tree> <input type="hidden" name="proposal/recomend_org_value"
			value="<x:out select="$xmlData/data/proposal/recomend_org_value" />" />
			<input type="hidden" name="proposal/recomend_org_name"
			value="<x:out select="$xmlData/data/proposal/recomend_org_name" />" /> 
			<%-- <x:out select="$xmlData/data/proposal/recomend_org_name" /> --%>
		</td>
	</tr>
	<tr class="li_1">
	    <td   align="right" >通讯地址：</td>
		<td  colspan="2">
			<x:out select="$xmlData/data/recommend/address" />
		</td>
		<td   align="right" >邮政编码：</td>
		<td  colspan="2">
			<x:out select="$xmlData/data/recommend/zip_code" />
		</td>
    </tr>
    
    <tr class="li_2">
	    <td   align="right" >联系人：</td>
		<td  colspan="2">
			<x:out select="$xmlData/data/recommend/contact_psn_name" />
		</td>
		<td   align="right" >联系电话：</td>
		<td  colspan="2">
			<x:out select="$xmlData/data/recommend/contact_tel_work" />
		</td>
    </tr>
    
    <tr class="li_1">
	    <td   align="right" >电子信箱：</td>
		<td  colspan="2">
			<x:out select="$xmlData/data/recommend/contact_psn_email" />
		</td>
		<td   align="right" >传真：</td>
		<td  colspan="2">
			<x:out select="$xmlData/data/recommend/contact_fax" />
		</td>
    </tr>
    

     
	</table>
	<br/>

<script type="text/javascript">
function initTreeValue2_qhh(treeId, treeNode) {
  	//针对单位性质
  	if (( treeNode && treeNode.isParent)) {
		scmWarn("请选择具体的"+$("#" + treeId).attr("label"));
			$("#" + treeId).val("");
			$("#" + treeId).parents("td").find("[name$='" + treeId + "_code'],[id$='" + treeId+ "_code']").val("");
			$("#" + treeId).parents("td").find("[name$='" + treeId + "_value'],[id$='" + treeId+ "_value']").val("");
			$("#" + treeId).parents("td").find("[name$='" + treeId + "_name'],[id$='" + treeId+ "_name']").val("");
			return false;
	}
		var str = treeNode.name;
		var obj = treeNode.parentNode;
		while (obj != null) {
			//str = obj.name + "-" + str;
			obj = obj.parentNode;
		}
		$("#" + treeId).parents("td").find("[name$='" + treeId + "_code'],[id$='" + treeId + "_code']").val(treeNode.id);
		$("#" + treeId).parents("td").find("[name$='" + treeId + "_value'],[id$='" + treeId + "_value']").val(treeNode.id);
		$("#" + treeId).parents("td").find("[name$='" + treeId + "_name'],[id$='" + treeId + "_name']").val(str);
		$("#" + treeId).val(str);
		
	
		setInformation(treeNode.id);
	}

	function setInformation(re_org_code){
		
		if(re_org_code !=null){
		 $.ajax({
	         type: "post",
	         url: "${ctx}/proposal/get-reorg-contactinfo",
	         data: {re_org_code:re_org_code},
	         dataType: "json",
	         success: function(data){
	        	            /*   alert(JSON.stringify(data) );
	        	            alert(data.PNAME); */
	        	       if(data.PNAME == null || data.TEL == null || data.EMAIL == null || data.FAX == null){
	        	    	   irisValaddMsg("请联系相应的推荐单位完善单位信息");
	        	       }else{
	        	    	   $("#reco_lixiren").val(data.PNAME);
	                   $("#reco_mobile").val(data.TEL);
	                   $("#reco_email").val(data.EMAIL);
	                   $("#reco_fax").val(data.FAX);
	                   }
	                  }
	     });
		}
	}
</script>
	
	
	
	
	
	
	
	
	
	
	
	
	
	